package com.frogs.ucenter.service.daoimpl;

import java.util.Arrays;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.frogs.framework.base.dao.BaseDao;
import com.frogs.framework.base.service.daoimpl.BaseServiceImpl;
import com.frogs.ucenter.dao.UserRechargeStrategyDao;
import com.frogs.ucenter.entity.UserRechargeStrategy;
import com.frogs.ucenter.service.UserRechargeStrategyService;

@Transactional(propagation=Propagation.REQUIRED, rollbackFor=Exception.class) 
@Service("userRechargeStrategyService")
public class UserRechargeStrategyServiceImpl extends BaseServiceImpl<UserRechargeStrategy> implements UserRechargeStrategyService {
    
	private static final Logger log = LoggerFactory.getLogger(UserRechargeStrategyServiceImpl.class);
	
	@Autowired
    private UserRechargeStrategyDao userRechargeStrategyDao;

    public UserRechargeStrategyServiceImpl() {
        super();
    }

    public UserRechargeStrategyDao getUserRechargeStrategyDao() {
        return userRechargeStrategyDao;
    }

    /**
     * Don't remove or edit it.
     */
    @Override
    protected BaseDao<UserRechargeStrategy> getBaseDao() {
        return userRechargeStrategyDao;
    }

    public void setUserRechargeStrategyDao(UserRechargeStrategyDao userRechargeStrategyDao) {
        this.userRechargeStrategyDao = userRechargeStrategyDao;
    }

	@Override
	public void insertById(Integer id) {
		try {
			userRechargeStrategyDao.insertById(id);
		} catch (Exception e) {
			log.error("func[insertById] id[{}] exception[{} - {}] desc[fail]",
    				new Object[] { id, Arrays.deepToString(e.getStackTrace()) });
		}
	}
}